@extends('home.layout.base')
<link rel="stylesheet" href="{{URL::asset('./css/hrmy/index.css')}}">

@section('content')
<div class="main" id="hrIndex">
    <div class="storelistTitle">
        <span class="storelistTitle_left">
            <span>

                <img src="{{URL::asset('./img/icon/home.png')}}">
            </span>
            <span><a href="{{route('home.index.index') }}">首页</a> > 用户中心</span>
        </span>
        <span class="storelistTitle_right">
            <span>找不到合适的供应商？发个需求试试？</span>
            <button @click=" window.location.href = '{{ route('home.demand.demandAdd') }}'">免费发布需求</button>
        </span>
    </div>
    <div class="hrContent">
        @include('home.hrmy.menu')
        <div class="hrContentRight"  id="hrIndexs" >
            <div class="myOrder">
                <div class="myTitle">
                    <div><span></span>我的订单</div>
                    <a href="{{route('home.hrmy.hrOrder')}}">订单管理中心 ></a>
                </div>
                <div class="myMesContent">
                    <div>
                        <a href="{{route('home.hrmy.hrOrder')}}">
                            <img src="{{URL::asset('./img/icon/obligation.png')}}">
                            待付款
                            <span>
                                （@{{userInfo.order_wait_pay}}）
                            </span>
                        </a>
                    </div>
                    <div>
                        <a href="{{route('home.hrmy.hrOrder')}}">
                            <img src="{{URL::asset('./img/icon/drop-shipping.png')}}">
                            待发货
                            <span>
                                （@{{userInfo.order_wait_send}}）
                            </span>
                        </a>
                    </div>
                    <div>
                        <a href="{{route('home.hrmy.hrOrder')}}">
                            <img src="{{URL::asset('./img/icon/waitreceiving.png')}}">
                            待收货
                            <span>
                                （@{{userInfo.order_wait_take}}）
                            </span>
                        </a>
                    </div>
                    <div>
                        <a href="{{route('home.hrmy.hrOrder')}}">
                            <img src="{{URL::asset('./img/icon/remain.png')}}">
                            待评价
                            <span>
                                （@{{userInfo.order_wait_evaluate}}）
                            </span>
                        </a>
                    </div>
                </div>
            </div>
            <div class="myPropertys">
                <div class="myProperty">
                    <div class="myTitle">
                        <div><span></span>我的资产</div>
                        <a href="{{route('home.hrmy.hrAssets') }}">资产管理中心 ></a>
                    </div>
                    <div class="integralBalance">
                        <a style="margin-right:109px;">
                            <span class="spanImg">
                                <img src="{{URL::asset('./img/icon/integral.png')}}">
                            </span>
                            <span class="spanMes">
                                <p>积分</p>
                                <p>@{{userInfo.integral}}分</p>
                            </span>
                        </a>
                        <a>
                            <img src="{{URL::asset('./img/icon/balance.png')}}">
                            <span class="spanMes">
                                <p>余额</p>
                                <p>@{{userInfo.balance}}元</p>
                            </span>
                        </a>
                    </div>
                </div>
                <div class="myCollect">
                    <div class="myTitle">
                        <div><span></span>我的收藏</div>
                    </div>
                    <div class="CollectMes">
                        <a href="{{route('home.hrmy.hrCollectStore')}}">
                            <span>@{{userInfo.collect_store}}</span>
                            <span>店铺收藏</span>
                        </a>
                        <a href="{{route('home.hrmy.hrCollectGoods')}}">
                            <span>@{{userInfo.collect_goods}}</span>
                            <span>商品收藏</span>
                        </a>
                        <a href="{{route('home.hrmy.hrCollectWord')}}">
                            <span>@{{userInfo.collect_word}}</span>
                            <span>文档收藏</span>
                        </a>
                        <a href="{{route('home.hrmy.hrCollectNews')}}">
                            <span>@{{userInfo.collect_news}}</span>
                            <span>新闻收藏</span>
                        </a>
                    </div>
                </div>
            </div>
            <div class="myFootprint">
                <div class="myTitle">
                    <div><span></span>我的足迹</div>
                    <a href="{{route('home.hrmy.hrFootprint')}}">查看更多 ></a>
                </div>
                <div class="footprintMian" v-for="(item,index) in footprint">
                    <!-- 供应商 -->
                    <div class="footprint_store" v-if="item.type==1">
                        <img :src="item.store.logo">
                        <div>
                            <p class="footprint_title">
                                <span class="footprint_name">@{{item.store.store_name}}
                                    <img v-if="item.store.quality==2" src="{{URL::asset('./img/icon/storeColloct.png')}}">
                                    <img v-if="item.store.hot==2" src="{{URL::asset('./img/icon/storeHot.png')}}">
                                </span>
                                <span class="browseTime"> 浏览于<span>
                                        @{{item.created_at}}
                                    </span></span>
                            </p>
                            <p class="footprint_1">
                                <span style="color:#333333">
                                    <img src="{{URL::asset('./img/icon/storeListTel.png')}}">
                                    @{{item.store.call}}
                                </span>
                                <span>
                                    <img src="{{URL::asset('./img/icon/storeListNote.png')}}">
                                    @{{item.store.service}}
                                </span>
                                <span>
                                    <img src="{{URL::asset('./img/icon/storeListEye.png')}}">
                                    @{{item.store.view}}
                                </span>
                                <span>
                                    <img src="{{URL::asset('./img/icon/storeListZan.png')}}">
                                    @{{item.store.praise}}
                                </span>
                            </p>
                            <p>
                                @{{item.store.service_scope}}
                        </div>
                        <button @click=" window.location.href = '{{ route('home.store.store') }}?id='+item.store.id">
                            查看详情
                        </button>
                    </div>
                    <!-- 产品 -->
                    <div class="footprint_goods" v-if="item.type==3">
                        <img :src="item.goods.thumb">
                        <div>
                            <p class="footprint_title">
                                <span class="footprint_name">@{{item.goods.title}}
                                </span>
                                <span class="browseTime"> 浏览于<span>
                                        @{{item.created_at}}
                                    </span></span>
                            </p>
                            <p class="footprint_goodsMes">
                                @{{item.goods.description}}
                            </p>
                            <p class="footprint_goodsFooter">
                                <span>
                                    <img src="{{URL::asset('./img/icon/storeListEye.png')}}">
                                    @{{item.goods.salenum}}
                                </span>
                                <a>
                                    ￥
                                    <span>
                                        @{{item.goods.price}}
                                    </span>
                                </a>
                            </p>
                        </div>
                        <button @click=" window.location.href = '{{ route('home.goods.goodsDetails') }}?goodsId='+item.goods.id+'&type='+item.goods.type">
                            查看详情
                        </button>
                    </div>
                    <!-- 活动 -->
                    <div class="footprint_activity" v-if="item.type==4">
                        <img :src="item.act.thumb">
                        <div>
                            <p class="footprint_title">
                                <span class="footprint_name">@{{item.act.title}}
                                </span>
                                <span class="browseTime"> 浏览于<span>
                                        @{{item.created_at}}
                                    </span></span>
                            </p>
                            <p class="footprint_activityMes">
                                <span>
                                    <img src="{{URL::asset('./img/icon/storeListEye.png')}}">
                                    @{{item.act.view}}
                                </span>
                                <span>
                                    <img src="{{URL::asset('./img/icon/child.png')}}">
                                    @{{item.act.number}}
                                </span>
                                <span>
                                    <img src="{{URL::asset('./img/icon/monyred.png')}}">
                                    @{{item.act.cost}}
                                </span>
                                <span>
                                    <img src="{{URL::asset('./img/icon/timeyellow.png')}}">
                                    @{{item.act.start_at}}
                                </span>
                            </p>
                        </div>
                        <button @click=" window.location.href = '{{ route('home.activity.actDetails') }}?cateId='+item.act.id">
                            查看详情
                        </button>
                    </div>
                    <!-- 文档 -->
                    <div class="footprint_word" v-if="item.type==5">
                        <img :src="item.word.thumb">
                        <div>
                            <p class="footprint_title">
                                <span class="footprint_name">@{{item.word.title}}
                                </span>
                                <span class="browseTime"> 浏览于<span>
                                        @{{item.created_at}}
                                    </span></span>
                            </p>
                            <p class="footprint_wordMes footprint_activityMes">
                                <span>
                                    <img src="{{URL::asset('./img/icon/storeListEye.png')}}">
                                    @{{item.word.view}}
                                </span>
                                <span>
                                    <img src="{{URL::asset('./img/icon/download.png')}}">
                                    @{{item.word.download}}
                                </span>
                                <span>
                                    <img src="{{URL::asset('./img/icon/time.png')}}">
                                    @{{item.word.created_at}}
                                </span>
                                <span>
                                    <img v-if="item.word.format=='doc' || item.word.format=='docx'" src="{{URL::asset('./img/icon/downWord.png')}}">
                                    <img v-if="item.word.format=='ppt'" src="{{URL::asset('./img/icon/downPPT.png')}}">
                                    <img v-if="item.word.format=='pdf'" src="{{URL::asset('./img/icon/downPdf.png')}}">
                                    <img v-if="item.word.format=='xlsx' || item.word.format=='xls'" src="{{URL::asset('./img/icon/downExel.png')}}">
                                </span>
                            </p>
                        </div>
                        <button @click=" window.location.href = '{{ route('home.word.wordDetails') }}'">
                            查看详情
                        </button>
                    </div>
                    <!-- 需求 -->
                    <div class="footprint_demand" v-if="item.type==2">
                        <span class="itemMone">
                            <a>
                            ￥
                        </a>@{{item.demand.price}}万
                        </span>
                        <div>
                            <p class="footprint_title">
                                <span class="footprint_name">@{{item.demand.title}}
                                    <img v-if="item.demand.urgent==2" src="{{URL::asset('./img/icon/urgent.png')}}">
                                </span>
                                <span class="browseTime"> 浏览于<span>
                                @{{item.created_at}}
                                    </span></span>
                            </p>
                            
                            <p>@{{item.demand.content}}</p>
                            <p class="footprint_demandFooter">
                                <span>
                                    <a>
                                        @{{item.demand.number}}
                                    </a>
                                    竞标

                                </span>
                                <span>
                                    <a>
                                        @{{item.demand.created_at}}
                                    </a>
                                    发布
                                </span>
                                <span>
                                    <a>
                                        @{{item.demand.end_at}}
                                    </a>
                                    截止
                                </span>
                            </p>
                        </div>
                        <!-- <button @click=" window.location.href = '{{ route('home.demand.demandHRDetails') }}'"> -->
                        <button @click=" window.location.href = '{{ route('home.demand.demandHRDetails') }}?demandId='+item.demand.id">
                            查看详情
                        </button>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
@endsection
@section('compontentScipts')
<script>
    $(() => {
        let app = new Vue({
            el: '#hrIndexs',
            data: () => {
                return {
                    userInfo: {},
                    footprint: [],
                }
            },
            created() {
                this.getDetails();
            },
            mounted() {},
            methods: {
                getDetails() {
                    let data = {}
                    apiAjax("{{ route('home.user.userInfoApi')}}", 'get', data, (res) => {
                        if (res.code == 0) {
                            this.userInfo = res.data;
                            this.footprint = res.data.footprint;
                        } else {
                            this.$message({
                                message: res.msg,
                                type: 'warning'
                            });
                        }
                    }, (erro) => {});
                },
            }
        })
    })
</script>
@endsection